// 统一管理项目 用户相关的接口
import request from "@/utils/request";
// 项目用户相关的请求地址
enum API {
    GET_COLUMN_LIST = "/column",
    ADD_COLUMN = "/column/add",
    DELETE_COLUMN = "/column/delete",
    UPDATE_COLUMN = "/column/update",
    GET_COLUMN_NUMBAER = "/column/number",
    SEARCHCOLUMN_URL = "/column/search",
    SEARCHCOLUMN_NUMBER_URL = "/column/search/number"
}

export const getColumn = (id: number, pageNo: number, limit: number) => {
    return request.get(API.GET_COLUMN_LIST, { params: { id, pageNo, limit } });
}

export const reqAddColumn = (data: any) => {
    return request.post(API.ADD_COLUMN, data, { headers: { "Content-Type": "application/json;charset=UTF-8" } });
}
export const reqDeleteColumn = (ids: [number]) => {
    return request.delete(API.DELETE_COLUMN, { data: { ids } }, { headers: { "Content-Type": "application/json;charset=UTF-8" } });
}
export const reqUpdateColumn = (data: any) => {
    return request.post(API.UPDATE_COLUMN, data, { headers: { "Content-Type": "application/json;charset=UTF-8" } });
}

export const reqgetColumnNumber = () => {
    return request.get(API.GET_COLUMN_NUMBAER);
}

export const reqSearchColumn = (name: string, pageNo: number, limit: number) => {
    return request.get(API.SEARCHCOLUMN_URL, { params: { name, pageNo, limit } });
}
export const reqSearchColumnNumber = (name: string) => {
    return request.get(API.SEARCHCOLUMN_NUMBER_URL, { params: { name } });
}

